
// Docks wrapper
//
.dock-list {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  padding-right: 22px;
  height: 0;
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: $zindex-dock;
  max-width: calc(100% - 30px);

  &.maximize {
    z-index: $zindex-dock-maximize;
  }
}

@include media-down(sm) {
  .dock-list {
    padding-right: 7px;
    max-width: calc(100% - 23px);
  }
}

.modal-open .dock-list {
  z-index: $zindex-dock-open-modal;

  .dock {
    border-color: transparent;
    transition: border-color 0s;
  }

  .modal.in {
    background-color: rgba(0,0,0,0.3);
  }
}

// Single dock
//
.dock {
  border: 1px solid $color-divider-light;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin: 0 8px;
  transition: .3s;
  display: none;
  max-width: 100%;

  &:hover {
    box-shadow: 0 1px 30px rgba(0, 0, 0, 0.06);
  }

  &.reveal {
    display: block;
  }

  &.shake:not(.minimize),
  &.shake.minimize .dock-header {
    animation: h-shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
  }

  &.blink .dock-header {
    background-color: $color-pale-info;
  }

  &.minimize {

    transform: translateY( calc(100% - #{$dock-header-height}) );

    .dock-header {
      cursor: pointer;
    }

    .dock-body {
      width: 0;
      min-width: 0;
    }

    .dock-actions {

      margin-left: 20px;

      > * {
        display: none;
      }

      [data-dock="close"] {
        display: inline-block;
        opacity: 0;
      }
    }

    &:hover .dock-actions [data-dock="close"] {
      opacity: 1;
    }
  }


  &.maximize {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin-left: 0;
    margin-right: 0;
    z-index: $zindex-dock-maximize;

    .dock-body {
      width: 100%;
      height: 100%;
    }
  }
}

// Header
//
.dock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  height: $dock-header-height;
  background-color: $color-bg-lighter;
  border-bottom: 1px solid $color-divider-light;
  transition: .3s;
}

.dock-title {
  display: flex;
  font-weight: 300;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 8px;

  @include gap-items(8px);
}



.dock-actions {
  display: flex;
  flex-direction: row-reverse;
  position: relative;
  z-index: 9;
  color: $color-text-secondary;

  @include gap-items(8px);

  > *:not(.dropdown),
  > .dropdown .dropdown-toggle {
    min-width: 20px;
    height: $dock-header-height;
    text-align: center;
    opacity: .7;
    cursor: pointer;
    transition: .2s;

    &:hover {
      opacity: 1;
    }
  }


  > *:not(.dropdown),
  .dropdown-toggle {
    line-height: $dock-header-height;
  }

  [data-dock="close"],
  [data-dock="maximize"],
  [data-dock="minimize"] {
    &::before {
      font-family: $font-icon-themify;
    }
  }

  [data-dock="close"]::before {
    content: "\e646";
  }

  [data-dock="maximize"]::before {
    content: "\e6be";
    display: inline-block;
    transform: rotate(90deg);
  }

  [data-dock="minimize"]::before {
    content: "\e622";
    vertical-align: sub;
  }
}

.dock-header-inverse {

  .dock-info {
    color: #fff;
  }

  .dock-actions {
    color: #fff;
  }

}




// Body
//
.dock-body {
  flex: 1;
  background-color: #fff;
  min-height: 300px;
  min-width: 240px;
  max-width: 100%;
  width: 400px;
  height: 400px;
}

.dock-block {
  padding: 20px;
}




// Sizes
//
.dock-xs .dock-body {
  width: 260px;
  height: 300px;
}

.dock-sm .dock-body {
  width: 340px;
  height: 340px;
}

.dock-lg .dock-body {
  width: 480px;
  height: 480px;
}

.dock-xl .dock-body {
  width: 560px;
  height: 560px;
}




// Footer
//
.dock-footer {
  padding: 12px;
  background-color: #fff;
}


// Animation
//
@keyframes h-shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%, 80% {
    transform: translate3d(2px, 0, 0);
  }

  30%, 50%, 70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%, 60% {
    transform: translate3d(4px, 0, 0);
  }
}


@keyframes dock-show {
  0% {
    display: none;
    opacity: 0;
  }
  1% {
    display: block;
    opacity: 0;
    transform-origin: right bottom 0;
    transform: scale(0, 0);
  }
  100% {
    opacity: 1;
    transform: scale(1, 1);
  }
}

@keyframes dock-w {
  from {

  }
  to {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    margin: 0 8px;
  }
}
